﻿using Domain.Entity.System_operation;
using Domain.Entity.System_Ordermanagement;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EFCore.Configer.System_Ordermanagement
{
    public class OrdersConfiger : IEntityTypeConfiguration<Orders>
    {
        public void Configure(EntityTypeBuilder<Orders> builder)
        {
            builder.ToTable(nameof(Orders));
            builder.HasKey(e => e.Ord_id);
            builder.Property(e=>e.Ord_id).HasColumnType("bigint");
            builder.Property(e=>e.Ord_number).HasColumnType("varchar(64)");
            builder.Property(e=>e.Ord_startaddress).HasColumnType("varchar(200)");
            builder.Property(e=>e.Ord_destination).HasColumnType("varchar(200)");
            builder.Property(e=>e.Client_name).HasColumnType("varchar(64)");
            builder.Property(e=>e.Ord_state).HasColumnType("tinyint").HasComment("0:待调度");
            builder.Property(e=>e.Shipments_Contactname).HasColumnType("varchar(64)");
            builder.Property(e=>e.Shipments_ContactPhone).HasColumnType("varchar(64)");
            builder.Property(e=>e.Shipments_addres).HasColumnType("varchar(200)");
            builder.Property(e=>e.Receiving_Contactname).HasColumnType("varchar(64)");
            builder.Property(e=>e.Receiving_ContactPhone).HasColumnType("varchar(64)");
            builder.Property(e=>e.Receiving_addres).HasColumnType("varchar(200)");
            builder.Property(e=>e.Shipping_time).HasColumnType("DateTime");
            builder.Property(e=>e.Receiving_time).HasColumnType("DateTime");
            builder.Property(e=>e.Ord_type).HasColumnType("varchar(64)");
            builder.Property(e=>e.Ord_source).HasColumnType("varchar(64)");
            builder.Property(e=>e.Ord_remark).HasColumnType("varchar(500)");
            builder.Property(e=>e.Ord_time).HasColumnType("DateTime");
            builder.Property(e=>e.Create_time).HasColumnType("DateTime");
            builder.Property(e=>e.Create_by).HasColumnType("varchar(64)");
            builder.Property(e=>e.LastUpdate_time).HasColumnType("DateTime");
            builder.Property(e=>e.LastUpdate_by).HasColumnType("varchar(64)");
            builder.Property(e=>e.Del_flag).HasColumnType("tinyint");
            builder.Property(e=>e.Tran_type).HasColumnType("tinyint");
            builder.Property(e=>e.Count).HasColumnType("int");
            builder.Property(e=>e.Totalvolume).HasColumnType("float");
            builder.Property(e=>e.Cg_name).HasColumnType("varchar(64)");
            builder.Property(e=>e.Bill_method).HasColumnType("int");
            builder.Property(e=>e.Weight).HasColumnType("float");
            builder.Property(e=>e.Freight_costs).HasColumnType("Decimal");
            builder.Property(e=>e.Packag_fee).HasColumnType("Decimal");
            builder.Property(e=>e.Handling_fee).HasColumnType("Decimal");
            builder.Property(e=>e.Other_fee).HasColumnType("Decimal");
            builder.Property(e=>e.Freight_count).HasColumnType("Decimal");
            builder.Property(e=>e.Pay_as_you_go).HasColumnType("Decimal");
            builder.Property(e=>e.Prepayment).HasColumnType("Decimal");
            builder.Property(e=>e.Collect).HasColumnType("Decimal");
            builder.Property(e=>e.Periodical_payment).HasColumnType("Decimal");
            builder.Property(e=>e.Pay_count).HasColumnType("Decimal");
            builder.Property(e=>e.Carrier_name).HasColumnType("varchar(64)");
            builder.Property(e=>e.Carrier_contact_name).HasColumnType("varchar(64)");
            builder.Property(e=>e.Carrier_phone).HasColumnType("varchar(64)");
            builder.Property(e=>e.Driver_name).HasColumnType("varchar(64)");
            builder.Property(e=>e.Driver_phone).HasColumnType("varchar(64)");
            builder.Property(e=>e.Car_type).HasColumnType("int");
            builder.Property(e=>e.Car_long).HasColumnType("int");
            builder.Property(e=>e.Car_number).HasColumnType("varchar(64)");
            builder.Property(e=>e.Receivables_state).HasColumnType("int");
            builder.Property(e=>e.Take_orders_time).HasColumnType("DateTime");
        }
    }
}
